﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;

using System.Windows.Media;


namespace AnesSystem.Controls
{
    /// <summary>
    /// ConnectingLine.xaml 的交互逻辑
    /// </summary>
    public partial class ConnectingLine : UserControl
    {
        #region Variables

        #endregion

        #region Constructor

        public ConnectingLine()
        {
            InitializeComponent();
            _line.Stroke = Brushes.Red;
            Thickness = 1;
        }

        #endregion

        #region Properties

        public Brush Stroke
        {
            get
            {
                return _line.Stroke;
            }
            set
            {
                _line.Stroke = value;
            }
        }

        public double Thickness
        {
            get
            {
                return _line.StrokeThickness;
            }
            set
            {
                _line.StrokeThickness = value;
            }
        }

        public string Group { get; set; }

        #endregion

        #region 依赖属性

        public double X1
        {
            get { return (double)GetValue(X1Property); }
            set { SetValue(X1Property, value); }
        }

        // Using a DependencyProperty as the backing store for X1.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty X1Property =
            DependencyProperty.Register("X1", typeof(double), typeof(ConnectingLine), new PropertyMetadata(1.0));



        public double X2
        {
            get { return (double)GetValue(X2Property); }
            set { SetValue(X2Property, value); }
        }

        // Using a DependencyProperty as the backing store for X2.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty X2Property =
            DependencyProperty.Register("X2", typeof(double), typeof(ConnectingLine), new PropertyMetadata(1.0));



        public double Y1
        {
            get { return (double)GetValue(Y1Property); }
            set { SetValue(Y1Property, value); }
        }

        // Using a DependencyProperty as the backing store for Y1.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Y1Property =
            DependencyProperty.Register("Y1", typeof(double), typeof(ConnectingLine), new PropertyMetadata(1.0));



        public double Y2
        {
            get { return (double)GetValue(Y2Property); }
            set { SetValue(Y2Property, value); }
        }

        // Using a DependencyProperty as the backing store for Y2.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty Y2Property =
            DependencyProperty.Register("Y2", typeof(double), typeof(ConnectingLine), new PropertyMetadata(1.0));

        #endregion

        #region Event

        #endregion

        #region Private Methods

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion
    }
}
